#include<bits/stdc++.h>
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
typedef long long ll;
const ll N = 10120300500;
inline void write(register __int128 x)
{
	if(x<0)
	{
		putchar('-');
		x=-x;
	}
	if(x>9)write(x/10);
	putchar(x%10+48);
}
int main()
{
	ll sum = 2*N;
	__int128 ans = 0;
	for(int i=1;i<sqrt(sum);i++)
	{
		ll y=i;
		ll x=0;
		if(sum%i==0){
			x=sum/y;
			if((x+y)%2==0&&(x-y)%2==0){
				__int128 a = (x+y)/2;
				__int128 b = (x-y)/2;
				if((a*a-b*b) == sum){
					__int128 res = a*a;
					ans+=(res-N);
				}
			}
		}
	}
	write(ans);
	return 0;
}